package org.jeecg.modules.kuner.browsebase.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.kuner.browsebase.entity.KrBrowseBase;
import org.jeecg.modules.kuner.browsebase.service.IKrBrowseBaseService;
import org.jeecg.modules.kuner.browsebase.vo.BrowseHisVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;

/**
 * @Description: 浏览记录
 * @Author: jeecg-boot
 * @Date: 2025-02-19
 * @Version: V1.0
 */
@Api(tags = "浏览记录")
@RestController
@RequestMapping("/api/krBrowseBase")
@Slf4j
public class KrBrowseBaseApiController extends JeecgController<KrBrowseBase, IKrBrowseBaseService> {
    @Resource
    private IKrBrowseBaseService browseBaseService;


    @GetMapping("/myBrowse/{type}")
    @ApiOperation(value = "我的浏览记录", notes = "type 传递1查简历 传递2查岗位")
    public Result<IPage<BrowseHisVO>> myBrowse(
            @RequestParam(defaultValue = "1") Integer pageNo,
            @RequestParam(defaultValue = "10") Integer pageSize,
            @PathVariable String type
    ) {

        IPage<BrowseHisVO> page = browseBaseService.myBrowse(pageNo, pageSize, type);
        return Result.OK("查询成功！", page);
    }
}
